package com.louis.i18n;

import org.junit.jupiter.api.Test;

import java.util.Locale;
import java.util.ResourceBundle;

/**
 * @author XRY
 * @date 2023年06月29日10:27
 */
public class ResourceI18n {
    @Test
    public void testCN() {
        ResourceBundle bundle = ResourceBundle.getBundle("local", new Locale("zh", "CN"));
        String value = bundle.getString("localName");
        System.out.println("value = " + value);
        /*value = China*/
    }
    
    @Test
    public void testOther() {
        ResourceBundle bundle1 = ResourceBundle.getBundle("local", new Locale("en", "US"));
        String value = bundle1.getString("localName");
        System.out.println("value = " + value);
        /*value = USA*/
    }
}
